import request from '@/utils/request'

// 网络列表
export function getNetworkList(query) {
  return request({
    url: '/system/network/list',
    method: 'get',
    params: query
  })
}

// 新增网络
export function addNetwork(data) {
  return request({
    url: '/system/network/add',
    method: 'post',
    data
  })
}

// 编辑网络
export function updateNetwork(data) {
  return request({
    url: '/system/network/update',
    method: 'post',
    data
  })
}

// 网络详情
export function getNetworkDetail(id) {
  return request({
    url: `/system/network/detail?networkId=${id}`,
    method: 'get'
  })
}

// 获取网络成员列表
export function getNetworkMemberList(query) {
  return request({
    url: '/system/network/member/list',
    method: 'get',
    params: query
  })
}

// 添加网络成员
export function addNetworkMember(data) {
  return request({
    url: '/system/network/member/add',
    method: 'post',
    data
  })
}

// 批量删除网络成员
export function deleteNetworkMember(data) {
  return request({
    url: '/system/network/member/batch/delete',
    method: 'post',
    data
  })
}

// 新增网络成员,获取单位列表
export function getNetworkCompanyList(query) {
  return request({
    url: '/system/network/company/list',
    method: 'get',
    params: query
  })
}

// 设置为网络负责单位
export function setNetworkPerson(data) {
  return request({
    url: '/system/network/member/update',
    method: 'post',
    data
  })
}
